
// import jsonp from "jsonp";
// import JQuery from "jquery";
import getUrlParameter from "utils/getUrlParameter.js";
import Axios from "axios";
import log from "utils/log.js";

// initial state

export default {
	name: "index",
	state: {
		data: "",
		showWindow: false,
	},
	getters: {
		getDataVal: state => {
			return state.data
		},
		getShowWindow: state => {
			return state.showWindow
		},

	},
	
	mutations: {
		SET_AJAX_VAL: function(state, data) {
			state.data = data;
		},
		SET_SHOW_WINDOW: function(state, data) {
			state.showWindow = data;
		},


	},
	actions: {
		getDataVal: ({ commit, dispatch}, {loadFirst = true}) => {
		
			Axios({
				method: "get",
				url: "http://admin.mumway.com/api/resume/resume/id/"+getUrlParameter.GetQueryString("id"),
				responseType: "json"
			})
			.then(function(response) {
				// log.info(getUrlParameter.GetQueryString("id"));
				// log.info("--------------------------------------");
				// log.info(response.data.data);
				if (response.status == 200) {
					commit("SET_AJAX_VAL", response.data.data);
				}
			})
			.catch(function (error) {
				log.info(error);
			});
		},
	},
}
